package com.wuxi.scheduler.pojo.seer;


import lombok.Data;

import java.time.Instant;

@Data
public class SeerResponse<T> {
    private int code;
    private String msg;
    private String createOn;
    private T data;


    public SeerResponse(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        Instant now = Instant.now();
        this.createOn = now.toString();
    }
    public static SeerResponse<Void> ok() {
        return ok(null);
    }

    public static <T> SeerResponse<T> ok(T data) {
        return new SeerResponse<>(1000, "success", data);
    }

    public SeerResponse() {
    }

}
